﻿using System;
using System.Xml.Serialization;

namespace ApplicationSettingsManager
{
	[XmlRoot("tableStorageSettings")]
	[Serializable]
	public class TableStorageSettings
	{
		private string _datasTableName = "DatasTable";
		private string _regionsTableName = "RegionsTable";
		private string _lookupsTableName = "LookUpsTable";
		private string _allocationsTableName = "AllocationsTable";

		/// <summary>
		/// DatasTableName Property
		/// Has all data rows.
		/// </summary>
		public string DatasTableName
		{
			get { return _datasTableName; }
			set { _datasTableName = value; }
		}

		/// <summary>
		/// RegionsTableName Property
		/// </summary>
		/// <value>The name of all dictionary table.</value>
		public string RegionsTableName
		{
			get { return _regionsTableName; }
			set { _regionsTableName = value; }
		}

		/// <summary>
		/// LookUpsTableName Property
		/// </summary>
		/// <value>The name of all data table.</value>
		public string LookUpsTableName
		{
			get { return _lookupsTableName; }
			set { _lookupsTableName = value; }
		}

		/// <summary>
		/// AllocationsTableTableName Property
		/// </summary>
		public string AllocationsTableTableName
		{
			get { return _allocationsTableName; }
			set { _allocationsTableName = value; }
		}


		/// <summary>
		/// Sets the value.
		/// </summary>
		/// <param name="settingName">Name of the setting.</param>
		/// <param name="value">The value.</param>
		public void SetValue(string settingName, string value)
		{
			switch (settingName)
			{
				case "DatasTableName":
					_datasTableName = value;
					break;
				case "RegionsTableName":
					_regionsTableName = value;
					break;
				case "LookUpsTableName":
					_lookupsTableName = value;
					break;
				case "AllocationsTableTableName":
					_allocationsTableName = value;
					break;
			}

		}
	}
}
